/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.qinyeit.serviceapp.entity.enums.*;
import lombok.Builder;
import lombok.experimental.Tolerate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

/**
 * ClassName: VipRecord <br/>
 * Function: 会员记录 <br/>
 * date: 2018-12-04 11:16:34 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="vip_records")
public class VipRecord extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 卡的uuid 
    @Column(name="uuid", length = 300)
	private String uuid = null;

	// 类型(充值/消费/开卡/) 
    @Column(name="type", length = 300)
	@Enumerated(EnumType.STRING)
	private VipRecordType type = null;

	// 操作人名称 
    @Column(name="operator_name", length = 300)
	private String operatorName = null;

	// 会员名称 
    @Column(name="vip_name", length = 300)
	private String vipName = null;

	// 会员手机号 
    @Column(name="vip_phone", length = 300)
	private String vipPhone = null;

	// 卡号 
    @Column(name="card_no", length = 300)
	private String cardNo = null;

	// 卡种类 
    @Column(name="card_mode", length = 300)
	@Enumerated(EnumType.STRING)
	private CardSpeciesType cardMode = null;

	// 卡类型
	@Column(name = "card_type")
	private String cardType = null;

	// 卡押金 
    @Column(name="deposit",scale=2)
	private Double deposit = null;

	// 操作金额 
    @Column(name="amount",scale=2)
	private Double amount = null;

	// 赠送金额 
    @Column(name="gift_value",scale=2)
	private Double giftValue = null;

	// 赠送金额 
    @Column(name="gift_point",scale=2)
	private Double giftPoint = null;

	// 操作主账户金额 
    @Column(name="before_value",scale=2)
	private Double beforeValue = null;

	// 操作前赠送余额 
    @Column(name="before_gift",scale=2)
	private Double beforeGift = null;

	// 操作前积分 
    @Column(name="befor_point",scale=2)
	private Double beforPoint = null;

	// 操作后主账户金额 
    @Column(name="after_value",scale=2)
	private Double afterValue = null;

	// 操作后赠送金额 
    @Column(name="after_gift",scale=2)
	private Double afterGift = null;

	// 操作后积分 
    @Column(name="after_point",scale=2)
	private Double afterPoint = null;

	// 充值来源 
    @Column(name="platform", length = 300)
	@Enumerated(EnumType.STRING)
	private RechargeSource platform = null;

	// 目标卡号 
    @Column(name="target_no", length = 300)
	private String targetNo = null;

	// 卡状态 
    @Column(name="card_state", length = 300)
	@Enumerated(EnumType.STRING)
	private MemberCardState cardState = null;

	// 支付类型 
    @Column(name="pay_type", length = 300)
	@Enumerated(EnumType.STRING)
	private PayType payType = null;

	// 撤销的充值时间 
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
    @Column(name="undo_time")
	private Date undoTime = null;

	// 消费单号 
    @Column(name="order_no", length = 300)
	private String orderNo = null;

	// 返现金额 
    @Column(name="cast_back",scale=2)
	private Double castBack = null;

	// 退卡原因 
    @Column(name="back_desc", length = 300)
	private String backDesc = null;
	// 消费门店
    @Column(name="branch_name", length = 300)
	private String branchName = null;


    @Tolerate
	public VipRecord() {
		
	}
    @Tolerate
	public VipRecord(Long id){
    	super.setId(id);
    }
	
	/**
	 * 获取卡的uuid
	 */
	public String getUuid() {
		return this.uuid;
	}

    /**
     * 设置卡的uuid
     */
	public VipRecord setUuid(String uuid) {
		this.uuid = uuid;
		return this;
	}

	/**
	 * 获取操作人名称
	 */
	public String getOperatorName() {
		return this.operatorName;
	}

    /**
     * 设置操作人名称
     */
	public VipRecord setOperatorName(String operatorName) {
		this.operatorName = operatorName;
		return this;
	}

	/**
	 * 获取会员名称
	 */
	public String getVipName() {
		return this.vipName;
	}

    /**
     * 设置会员名称
     */
	public VipRecord setVipName(String vipName) {
		this.vipName = vipName;
		return this;
	}

	/**
	 * 获取会员手机号
	 */
	public String getVipPhone() {
		return this.vipPhone;
	}

    /**
     * 设置会员手机号
     */
	public VipRecord setVipPhone(String vipPhone) {
		this.vipPhone = vipPhone;
		return this;
	}

	/**
	 * 获取卡号
	 */
	public String getCardNo() {
		return this.cardNo;
	}

    /**
     * 设置卡号
     */
	public VipRecord setCardNo(String cardNo) {
		this.cardNo = cardNo;
		return this;
	}

	public String getCardType() {
		return cardType;
	}

	public void setCardType(String cardType) {
		this.cardType = cardType;
	}

	/**
	 * 获取卡押金
	 */
	public Double getDeposit() {
		return this.deposit;
	}

    /**
     * 设置卡押金
     */
	public VipRecord setDeposit(Double deposit) {
		this.deposit = deposit;
		return this;
	}

	/**
	 * 获取操作金额
	 */
	public Double getAmount() {
		return this.amount;
	}

    /**
     * 设置操作金额
     */
	public VipRecord setAmount(Double amount) {
		this.amount = amount;
		return this;
	}

	/**
	 * 获取赠送金额
	 */
	public Double getGiftValue() {
		return this.giftValue;
	}

    /**
     * 设置赠送金额
     */
	public VipRecord setGiftValue(Double giftValue) {
		this.giftValue = giftValue;
		return this;
	}

	/**
	 * 获取赠送金额
	 */
	public Double getGiftPoint() {
		return this.giftPoint;
	}

    /**
     * 设置赠送金额
     */
	public VipRecord setGiftPoint(Double giftPoint) {
		this.giftPoint = giftPoint;
		return this;
	}

	/**
	 * 获取操作主账户金额
	 */
	public Double getBeforeValue() {
		return this.beforeValue;
	}

    /**
     * 设置操作主账户金额
     */
	public VipRecord setBeforeValue(Double beforeValue) {
		this.beforeValue = beforeValue;
		return this;
	}

	/**
	 * 获取操作前赠送余额
	 */
	public Double getBeforeGift() {
		return this.beforeGift;
	}

    /**
     * 设置操作前赠送余额
     */
	public VipRecord setBeforeGift(Double beforeGift) {
		this.beforeGift = beforeGift;
		return this;
	}

	/**
	 * 获取操作前积分
	 */
	public Double getBeforPoint() {
		return this.beforPoint;
	}

    /**
     * 设置操作前积分
     */
	public VipRecord setBeforPoint(Double beforPoint) {
		this.beforPoint = beforPoint;
		return this;
	}

	/**
	 * 获取操作后主账户金额
	 */
	public Double getAfterValue() {
		return this.afterValue;
	}

    /**
     * 设置操作后主账户金额
     */
	public VipRecord setAfterValue(Double afterValue) {
		this.afterValue = afterValue;
		return this;
	}

	/**
	 * 获取操作后赠送金额
	 */
	public Double getAfterGift() {
		return this.afterGift;
	}

    /**
     * 设置操作后赠送金额
     */
	public VipRecord setAfterGift(Double afterGift) {
		this.afterGift = afterGift;
		return this;
	}

	/**
	 * 获取操作后积分
	 */
	public Double getAfterPoint() {
		return this.afterPoint;
	}

    /**
     * 设置操作后积分
     */
	public VipRecord setAfterPoint(Double afterPoint) {
		this.afterPoint = afterPoint;
		return this;
	}



	/**
	 * 获取目标卡号
	 */
	public String getTargetNo() {
		return this.targetNo;
	}

    /**
     * 设置目标卡号
     */
	public VipRecord setTargetNo(String targetNo) {
		this.targetNo = targetNo;
		return this;
	}


	/**
	 * 获取撤销的充值时间
	 */
	public Date getUndoTime() {
		return this.undoTime;
	}

    /**
     * 设置撤销的充值时间
     */
	public VipRecord setUndoTime(Date undoTime) {
		this.undoTime = undoTime;
		return this;
	}

	/**
	 * 获取消费单号
	 */
	public String getOrderNo() {
		return this.orderNo;
	}

    /**
     * 设置消费单号
     */
	public VipRecord setOrderNo(String orderNo) {
		this.orderNo = orderNo;
		return this;
	}

	/**
	 * 获取返现金额
	 */
	public Double getCastBack() {
		return this.castBack;
	}

    /**
     * 设置返现金额
     */
	public VipRecord setCastBack(Double castBack) {
		this.castBack = castBack;
		return this;
	}

	/**
	 * 获取退卡原因
	 */
	public String getBackDesc() {
		return this.backDesc;
	}

    /**
     * 设置退卡原因
     */
	public VipRecord setBackDesc(String backDesc) {
		this.backDesc = backDesc;
		return this;
	}

	public VipRecordType getType() {
		return type;
	}

	public void setType(VipRecordType type) {
		this.type = type;
	}

	public CardSpeciesType getCardMode() {
		return cardMode;
	}

	public void setCardMode(CardSpeciesType cardMode) {
		this.cardMode = cardMode;
	}

	public RechargeSource getPlatform() {
		return platform;
	}

	public void setPlatform(RechargeSource platform) {
		this.platform = platform;
	}

	public MemberCardState getCardState() {
		return cardState;
	}

	public void setCardState(MemberCardState cardState) {
		this.cardState = cardState;
	}

	public PayType getPayType() {
		return payType;
	}

	public void setPayType(PayType payType) {
		this.payType = payType;
	}

	public String getBranchName() {
		return branchName;
	}

	public void setBranchName(String branchName) {
		this.branchName = branchName;
	}
}
